import services from '@/services'

const state = {
  articleList: [],
};
const mutations = {
  getArticleList(state, data) {
    state.articleList = data;
  },
};
const actions = {
  /**
   * 获取博客列表
   */
  async articleList(store, params) {
    const {
      data = {}
    } = await services.article.getArticleList(params);
    store.commit("getArticleList", data.data);
    return data;
  },
  /**
   * 获取博客详情
   */
  async articleInfo(store,params) {
    const {
      data = {}
    } = await services.article.getArticleInfo(params);
    return data;
  }
};
const getters = {}
export default {
  namespaced: true,
  state,
  actions,
  mutations,
  getters
}
